package com.jiuqi.irs.generator.form;

import java.text.SimpleDateFormat;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for tbDeclare.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="tbDeclareForm"
 */
public class TbDeclareForm extends ActionForm {

	private final static SimpleDateFormat FORMAT = new SimpleDateFormat(
			"dd.MM.yyyy hh:mm:ss");

	private java.lang.String declareGuid = null;

	private java.lang.String orgGuid = null;

	private java.lang.String canceltaskGuid = null;

	private java.lang.String declareState = null;

	private java.lang.String declareLevel = null;

	private java.lang.String declareYear = null;

	private java.lang.String declareTime = null;

	private java.lang.String handlePerson = null;

	private java.lang.String reserved1 = null;

	private java.lang.String reserved2 = null;

	private java.lang.String reserved3 = null;

	/**
	 * Standard constructor.
	 */
	public TbDeclareForm() {

	}

	public java.lang.String getDeclareGuid() {
		return declareGuid;
	}

	public void setDeclareGuid(java.lang.String declareGuid) {
		this.declareGuid = declareGuid;
	}

	public java.lang.String getOrgGuid() {
		return orgGuid;
	}

	public void setOrgGuid(java.lang.String orgGuid) {
		this.orgGuid = orgGuid;
	}

	public java.lang.String getCanceltaskGuid() {
		return canceltaskGuid;
	}

	public void setCanceltaskGuid(java.lang.String canceltaskGuid) {
		this.canceltaskGuid = canceltaskGuid;
	}

	public java.lang.String getDeclareState() {
		return declareState;
	}

	public void setDeclareState(java.lang.String declareState) {
		this.declareState = declareState;
	}

	public java.lang.String getDeclareLevel() {
		return declareLevel;
	}

	public void setDeclareLevel(java.lang.String declareLevel) {
		this.declareLevel = declareLevel;
	}

	public java.lang.String getDeclareYear() {
		return declareYear;
	}

	public void setDeclareYear(java.lang.String declareYear) {
		this.declareYear = declareYear;
	}

	public java.lang.String getDeclareTime() {
		return declareTime;
	}

	public void setDeclareTime(java.lang.String declareTime) {
		this.declareTime = declareTime;
	}

	public java.lang.String getHandlePerson() {
		return handlePerson;
	}

	public void setHandlePerson(java.lang.String handlePerson) {
		this.handlePerson = handlePerson;
	}

	public static SimpleDateFormat getFORMAT() {
		return FORMAT;
	}

	public java.lang.String getReserved1() {
		return reserved1;
	}

	public void setReserved1(java.lang.String reserved1) {
		this.reserved1 = reserved1;
	}

	public java.lang.String getReserved2() {
		return reserved2;
	}

	public void setReserved2(java.lang.String reserved2) {
		this.reserved2 = reserved2;
	}

	public java.lang.String getReserved3() {
		return reserved3;
	}

	public void setReserved3(java.lang.String reserved3) {
		this.reserved3 = reserved3;
	}

	public static SimpleDateFormat getFormat() {
		return FORMAT;
	}

	/**
	 * Validate the properties that have been set from this HTTP request,
	 * and return an <code>ActionErrors</code> object that encapsulates any
	 * validation errors that have been found.  If no errors are found, return
	 * <code>null</code> or an <code>ActionErrors</code> object with no
	 * recorded error messages.
	 *
	 * @param mapping The mapping used to select this instance
	 * @param request The servlet request we are processing
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		// test for nullity
		if (getOrgGuid() == null) {
			errors.add("declareGuid", new ActionError(
					"error.declareGuid.required"));
		}
		// TODO test format/data
		return errors;
	}
}
